Optimal. Leaf size=93 \[ -\frac{\left (a^2-3 b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}-\frac{\sec ^2(c+d x) \left (\left (a^2+3 b^2\right ) \sin (c+d x)+4 a b\right )}{8 d}+\frac{\tan (c+d x) \sec ^3(c+d x) (a+b \sin (c+d x))^2}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.194086, antiderivative size = 93, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {2837, 12, 1645, 778, 206} \[ -\frac{\left (a^2-3 b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}-\frac{\sec ^2(c+d x) \left (\left (a^2+3 b^2\right ) \sin (c+d x)+4 a b\right )}{8 d}+\frac{\tan (c+d x) \sec ^3(c+d x) (a+b \sin (c+d x))^2}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2837
Rule 12
Rule 1645
Rule 778
Rule 206
Rubi steps
\begin{align*} \int \sec ^3(c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx &=\frac{b^5 \operatorname{Subst}\left (\int \frac{x^2 (a+x)^2}{b^2 \left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac{b^3 \operatorname{Subst}\left (\int \frac{x^2 (a+x)^2}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac{\sec ^3(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x)}{4 d}+\frac{b \operatorname{Subst}\left (\int \frac{(a+x) \left (-a b^2-3 b^2 x\right )}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=-\frac{\sec ^2(c+d x) \left (4 a b+\left (a^2+3 b^2\right ) \sin (c+d x)\right )}{8 d}+\frac{\sec ^3(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x)}{4 d}-\frac{\left (b \left (a^2-3 b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{8 d}\\ &=-\frac{\left (a^2-3 b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}-\frac{\sec ^2(c+d x) \left (4 a b+\left (a^2+3 b^2\right ) \sin (c+d x)\right )}{8 d}+\frac{\sec ^3(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x)}{4 d}\\ \end{align*}
Mathematica [A] time = 0.746953, size = 85, normalized size = 0.91 \[ -\frac{\left (a^2-3 b^2\right ) \tanh ^{-1}(\sin (c+d x))+\frac{1}{4} \sec ^4(c+d x) \left (2 \sin (c+d x) \left (\left (a^2+5 b^2\right ) \cos (2 (c+d x))-3 a^2+b^2\right )+16 a b \cos (2 (c+d x))\right )}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.062, size = 209, normalized size = 2.3 \begin{align*}{\frac{{a}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{4\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}}+{\frac{{a}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{8\,d \left ( \cos \left ( dx+c \right ) \right ) ^{2}}}+{\frac{{a}^{2}\sin \left ( dx+c \right ) }{8\,d}}-{\frac{{a}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}}+{\frac{ab \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{2\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}}+{\frac{{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{5}}{4\,d \left ( \cos \left ( dx+c \right ) \right ) ^{4}}}-{\frac{{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{5}}{8\,d \left ( \cos \left ( dx+c \right ) \right ) ^{2}}}-{\frac{{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{8\,d}}-{\frac{3\,{b}^{2}\sin \left ( dx+c \right ) }{8\,d}}+{\frac{3\,{b}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.976745, size = 162, normalized size = 1.74 \begin{align*} -\frac{{\left (a^{2} - 3 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) -{\left (a^{2} - 3 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac{2 \,{\left (8 \, a b \sin \left (d x + c\right )^{2} +{\left (a^{2} + 5 \, b^{2}\right )} \sin \left (d x + c\right )^{3} - 4 \, a b +{\left (a^{2} - 3 \, b^{2}\right )} \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1}}{16 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.02974, size = 309, normalized size = 3.32 \begin{align*} -\frac{{\left (a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) -{\left (a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 16 \, a b \cos \left (d x + c\right )^{2} - 8 \, a b + 2 \,{\left ({\left (a^{2} + 5 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.27209, size = 167, normalized size = 1.8 \begin{align*} -\frac{{\left (a^{2} - 3 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) -{\left (a^{2} - 3 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac{2 \,{\left (a^{2} \sin \left (d x + c\right )^{3} + 5 \, b^{2} \sin \left (d x + c\right )^{3} + 8 \, a b \sin \left (d x + c\right )^{2} + a^{2} \sin \left (d x + c\right ) - 3 \, b^{2} \sin \left (d x + c\right ) - 4 \, a b\right )}}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{16 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]